// 普通用户
import request from '@/api/socialized-servce/index.js' //引入http.js
const api = request
export default {
	// 查询订单
	queryMyOrder(params) {
		let url = 'service/service/order/queryContactMyPageByCondition'
		return api.request(url, 'post', {
			...params
		})
	},
	// 确认是否完成线下支付
	completePay(params) {
		let url = `service/service/order/pay/${params.orderId}`
		return api.request(url, 'put')
	},
	// 删除订单
	delOrder(id) {
		let url = `service/service/order/delContact/${id}`
		return api.request(url, 'PUT')
	},
	// 发起取消
	applayCancelOrder(params) {
		let url = `service/service/close/add/apply`
		return api.request(url, 'POST', {
			...params
		})
	},
	// 确认取消服务
	confirmCancel(params) {
		let url = 'service/service/close/result'
		return api.request(url, 'POST', {
			...params
		})
	},
	// 订单投诉
	orderComplaint(params) {
		let url = 'service/service/serviceComplain/add/apply'
		return api.request(url, 'POST', {
			...params
		})
	},
	// 撤销投诉
	repealOrderComplaint(orderNo) {
		let url = `service/service/serviceComplain/quash/${orderNo}`
		return api.request(url, 'PUT')
	},
	// 获取项目
	queryProject(params) {
		let url = 'service/service/project/queryByCondition'
		return api.request(url, 'POST',{
			...params
		})
	},
	// 获取取消原因模板
	queryCancelReasonTemplate(serviceProjectNo) {
		let url = `service/service/reason/template/close?serviceProjectNo=${serviceProjectNo}`
		return api.request(url, 'GET')
	},
	// 获取投诉原因模板
	queryComplainReasonTemplate(serviceProjectNo) {
		let url = `service/service/reason/template/complain?serviceProjectNo=${serviceProjectNo}`
		return api.request(url, 'GET')
	}
}